#include<iostream>
using namespace std;

#include"list.h"
#include"vector.h"
#include"reverse_iterator.h"

void test_list1()
{
	cyq::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	lt.push_front(0);
	lt.push_front(0);

	cyq::list<int>::iterator it = lt.begin();
	while (it != lt.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;

	lt.pop_back();
	lt.pop_front();

	cyq::list<int>::iterator it1 = lt.begin();
	while (it1 != lt.end())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;

	cyq::list<int>::reverse_iterator it2 = lt.rbegin();
	while (it2 != lt.rend())
	{
		cout << *it2 << " ";
		++it2;
	}
	cout << endl;

}

void test_vector1()
{
	cyq::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);

	cyq::vector<int>::iterator it = v.begin();
	while (it != v.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;

	v.pop_back();
	v.pop_back();
	cyq::vector<int>::iterator it1 = v.begin();
	while (it1 != v.end())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;

	cyq::vector<int>::reverse_iterator it2 = v.rbegin();
	while (it2 != v.rend())
	{
		cout << *it2 << " ";
		it2++;
	}
	cout << endl;


}


int main()
{
	test_list1();
	cout << "----------------------------" << endl;

	test_vector1();
	cout << "----------------------------" << endl;

	return 0;
}